package com.wlyuan.open.config;

import com.wlyuan.open.interceptor.CustomAuthenticationInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author lijing
 * @description
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Autowired
    private CustomAuthenticationInterceptor customAuthenticationInterceptor;

    /**
     * 自定义拦截规则
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(customAuthenticationInterceptor).addPathPatterns("/api/**");
    }
}
